{% extends "base_petadmin.html" %}

{% block mainheading %}Profit-losses{% endblock %}

{% block content %}
    
<form action="." method="post">
{% csrf_token %}
<input type="hidden" name="year" value="{{ year }}" />
<table>
    <tr class="row">
        <th nowrap>
        <a href="/pet/profitlosses?year={{ year_prev }}">&laquo;</a>
        {{ year }}
        {% if year_next > 0 %}
            <a href="/pet/profitlosses?year={{ year_next }}">&raquo;</a>
        {% endif %}
        </th>
        {% for m in ar_months %}
            <th>{{ m }}</th>
        {% endfor %}
    </tr>
        {% for currency, items in ar_profits.items %}
        <tr class="{% cycle "row1" "row2" %}">
            <th>{{ currency }}</th>
            
            {% for v in items %}
                <td><input type="text" name="ex[{{ currency }}][{{ forloop.counter }}]" value="{{ v }}" style="width: 40px;" /></td>
            {% endfor %}
            
        </tr>
        {% endfor %}
        
    <tr>
        <td colspan="13" align="right"><input type="submit" value="Save" class="default" /></td>
    </tr>

</table>
</form>    
    
{% endblock %}
